The extent of compression realized by application of conventional image compression techniques varies greatly depending on the image. Typical compression values for pages of text are between 6% and 10% of the original size the image occupies when stored in memory in an uncompressed format. Worst case photo images typically compress between 33% and 50% their original size. Other compression methods such as arithmetic encoding tend to compress text images to 4% to 8% of their original size, and worst case photo images do no better than 28% of their original size. Compression schemes, such as arithmetic coding, can take a very long time to compress, and also they do not compress individual lines very efficiently, or produce output that is segmented into lines. Thus, there is a need in the art for a method that allows efficient compression of image data at a small cost in execution time.